#ifndef MYSPI_H
#define MYSPI_H

#include "main.h"

extern SPI_HandleTypeDef hspi1;
#define CS_ENABLE     HAL_GPIO_WritePin(GPIOA,SPI1_NSS_Pin,GPIO_PIN_RESET)
#define CS_DISENABLE  HAL_GPIO_WritePin(GPIOA,SPI1_NSS_Pin,GPIO_PIN_SET)

uint8_t SPI1_ReadWriteByte(uint8_t TxData);
void Myspi_Init(void);
void SPI1_Write(uint8_t* TxData, uint16_t len);
void SPI1_Read(uint8_t* RxData, uint16_t len);

#endif
